package com.groupten.Dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.groupten.Entity.StudentPaperEntity;
import com.groupten.Vo.IndividualVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;
import java.util.Map;

@Mapper
public interface StudentPaperDao extends BaseMapper<StudentPaperEntity> {

    @Select("select * from student_paper where is_attend_count IS FALSE ")
    List<StudentPaperEntity> getStudentPaperByIsAttendCount();

    @Update("update `student_paper` set is_attend_count = TRUE where student_number = #{studentNumber} ")
    int updateIsAttendCount(String studentNumber);

    @Select("select distinct paper_session from paper where paper_subject  = #{paperSubject} ")
    List<Integer> getPaperSessionByPaperSubject(Integer paperSubject);

    @Select("select distinct paper_subject from paper where paper_session = #{paperSession}")
    Integer getPaperSubjectBySession(Integer paperSession);

    @Select("select paper_session from student_paper where student_number = #{studentNumber} ")
    List<Integer> getStudentPapers(String studentNumber);

    @Select("select score from student_paper where paper_session = #{paperSession} and student_number = #{studentNumber} ")
    Double getStudentPaperScore(Integer paperSession, String studentNumber);


}
